﻿using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using System.Linq;
using System.Threading.Tasks;
using WalkingTec.Mvvm.Core;
using WalkingTec.Mvvm.Core.Extensions;
using BathhouseService.Models.SqlModels;


namespace BathhouseService.CURD.ViewModels.PackageServiceSettingsVMs
{
    public partial class PackageServiceSettingsTemplateVM : BaseTemplateVM
    {
        [Display(Name = "套餐")]
        public ExcelPropety PackageService_Excel = ExcelPropety.CreateProperty<PackageServiceSettings>(x => x.PackageServiceId);
        [Display(Name = "增值项目")]
        public ExcelPropety ValueAddedServices_Excel = ExcelPropety.CreateProperty<PackageServiceSettings>(x => x.ValueAddedServicesId);
        [Display(Name = "项目次数")]
        public ExcelPropety Count_Excel = ExcelPropety.CreateProperty<PackageServiceSettings>(x => x.Count);

	    protected override void InitVM()
        {
            PackageService_Excel.DataType = ColumnDataType.ComboBox;
            PackageService_Excel.ListItems = DC.Set<PackageService>().GetSelectListItems(LoginUserInfo?.DataPrivileges, null, y => y.Name);
            ValueAddedServices_Excel.DataType = ColumnDataType.ComboBox;
            ValueAddedServices_Excel.ListItems = DC.Set<ValueAddedServices>().GetSelectListItems(LoginUserInfo?.DataPrivileges, null, y => y.Names);
        }

    }

    public class PackageServiceSettingsImportVM : BaseImportVM<PackageServiceSettingsTemplateVM, PackageServiceSettings>
    {

    }

}
